import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_demo_k/page/pageview_count.dart';
import 'package:flutter_demo_k/page/repaint_boundary_test.dart';
import 'package:flutter_demo_k/page/stream_builder_test.dart';
import 'package:flutter_demo_k/view/custom_app_bar.dart';
import 'package:one_context/one_context.dart';

import 'drift_test.dart';
import 'inherited_notifiter_widget.dart';
import 'inherited_page.dart';

class Index extends StatelessWidget {
  const Index({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CustomAppBar(
        title: '测试',
        showLeftButton: false,
      ),
      body: Center(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            GestureDetector(
              child: const Text('StreamBuilder测试'),
              onTap: () => OneContext().pushNamed(StreamBuilderTest.routeName),
            ),
            GestureDetector(
              child: const Text('RepaintBoundTest'),
              onTap: () =>
                  OneContext().pushNamed(RepaintBoundaryTest.routeName),
            ),
            GestureDetector(
              child: const Text('InheritedWidget'),
              onTap: () => OneContext().pushNamed(InheritedPage.routeName),
            ),
            GestureDetector(
              child: const Text('InheritedNotifierTest'),
              onTap: () => OneContext().pushNamed(
                  InheritedNotifierPage.routeName,
                  arguments: {'data': "krcm110"}),
            ),
            GestureDetector(
              child: const Text('解决滑动兼容bug'),
              onTap: () => OneContext().pushNamed(PageViewCount.routeName),
            ),
            GestureDetector(
              child: const Text('数据库测试'),
              onTap: () => OneContext().pushNamed(DriftTest.routeName),
            ),
          ],
        ),
      ),
    );
  }
}
